package com.itheima.fanshe;

import com.itheima.domain.Student;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Demo05 {

    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException {


        Class<? extends Student> clazz = Student.class;
        Method eat = clazz.getDeclaredMethod("eat");
        eat.setAccessible(true);
        eat.invoke(clazz.newInstance());


    }
}
